home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-09 | 730 b | 24 lines | [TEXT/MEDT] |
- MODULE Example; (* W. Heiz, 26-Feb-86 / A. Fischlin, 4-Sep-92 *)
-
- (* this program will produce two runtime errors (why?) *)
-
- FROM Terminal IMPORT WriteString, WriteLn;
-
- VAR x: INTEGER;
- a: ARRAY [0..10] OF BOOLEAN;
-
- PROCEDURE P(i: INTEGER; p: BOOLEAN);
- BEGIN
- a[i] := p; (* this statement should be high-lighted; Select Quit, then «Abort» *)
- END P;
-
- BEGIN
- WriteString('Welcome to the wonderful world of Modula-2'); WriteLn; WriteLn;
- WriteString("--- Debugger demo, please click in button «Debug» or type 'D'"); WriteLn;
- x := 14;
- P(0, TRUE);
- HALT; (* Leave debugger by selecting menu command Continue *)
- WriteString("--- Please click in button «Debug» or type 'D'");
- P(x, FALSE);
- END Example.
-